<?php
namespace app\Logic\Layui\ServiceProviders;

use app\Logic\Container;

class Loger implements ServiceProviderInterface
{

    public $app;

    public function __construct(\Closure $app)
    {
        $this->app = $app($this);
    }


    /**
     * @param Container $app
     */
    public static function register(Container $app)
    {
        !isset($app->values['Loger']) && $app->values['Loger'] = function (\Closure $app){
            return new self($app);
        };
    }


    /**
     * @param $name
     * @param $arguments
     * @return mixed
     */
    public function __call($name,$arguments)
    {
        return $this->app->$name(...$arguments);
    }
}